package br.unicamp.ic.inf300.arena.persistencia.dao.impl;

import java.sql.SQLException;

import junit.framework.TestCase;

import org.apache.log4j.Logger;

import br.unicamp.ic.inf300.arena.persistencia.dao.IPagamentoDAO;
import br.unicamp.ic.inf300.framework.persistencia.DAOFactory;

public class PagamentoDAOHsqlTest extends TestCase {
	private static final String PERSISTENCIA_PROPERTIES = "br/unicamp/ic/inf300/persistencia.properties";

	private static Logger _logger = Logger.getLogger(PagamentoDAOHsqlTest.class
			.getName());	

	private static IPagamentoDAO daoPagto = null;

	protected void setUp() throws Exception {
		super.setUp();
		DAOFactory.getInstance(PERSISTENCIA_PROPERTIES);
		daoPagto = (IPagamentoDAO) DAOFactory.getImpl(IPagamentoDAO.class);
	}

	public void testObterPagamento() {
		try {
			_logger.debug("\n testObterPagamento() \n\n" );

			System.out.println("QTD. registros = " + daoPagto.obterCodPagto());
		}
		catch(SQLException sqlErr) {
			System.err.println( sqlErr.getMessage() );
			assertFalse(true);
		}
		catch(Exception err) {
			System.err.println( err.getMessage() );
			assertFalse(true);
		}
	}

	protected void tearDown() throws Exception {
		super.tearDown();
		daoPagto = null;
	}
}